[ElementTiming] Cleanup window.location.href usage in tests This CL removes window.location.href usage in element-timing tests and uses window.location.origin instead, which makes the pathname computation cleaner. It also adds t.step_func where it is missing. Change-Id: Iabaac33eb65f9ed24f68e7fa583c8de05d1264c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872762 Reviewed-by: Tom McKee <tommckee@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Cr-Commit-Position: refs/heads/master@{#707954} 
diff --git a/element-timing/disconnect-image.html b/element-timing/disconnect-image.html index 82e7461..fa42397 100644 --- a/element-timing/disconnect-image.html +++ b/element-timing/disconnect-image.html 
@@ -16,9 +16,7 @@  t.step_func_done(function(entryList) {  assert_equals(entryList.getEntries().length, 1);  const entry = entryList.getEntries()[0]; - const index = window.location.href.lastIndexOf('/'); - const pathname = window.location.href.substring(0, index) + - '/resources/square100.png'; + const pathname = window.location.origin + '/element-timing/resources/square100.png';  // This method will check that entry.element is |img|.  checkElement(entry, pathname, 'my_image', 'my_id', beforeRender, img);